graph TB
    subgraph 网关层
        GW["API Gateway (8080)"]
    end

    subgraph 订单服务
        OS_API["订单服务API (8081)"]
        OS_API --> OC["Command层"]
        OS_API --> OQ["Query层"]
        OC -->|本地调用| OS_CORE["核心业务"]
        OC -->|HTTP| IS_API["库存服务API (8082)"]
        OC -->|RPC| PS_API["支付服务API (8083)"]
    end

    subgraph 库存服务
        IS_API --> IC["库存Command"]
        IS_API --> IQ["库存Query"]
    end

    subgraph 支付服务
        PS_API --> PC["支付Command"]
        PS_API --> PQ["支付Query"]
    end

    GW -->|/api/orders/*| OS_API
    GW -->|/api/payments/*| PS_API
    GW -->|/api/inventory/*| IS_API

    classDef gateway fill:#2A3B4D,stroke:#5D8AA8,color:#FFF;
    classDef api fill:#4A6FA5,stroke:#A9D2FF,color:#FFF;
    classDef core fill:#3E5C76,stroke:#AED9E0,color:#FFF;
    classDef external fill:#88CCEE,stroke:#117733,color:#000;
    class GW gateway
    class OS_API,IS_API,PS_API api
    class OC,OQ,OS_CORE core
    class IC,IQ,PC,PQ external